package org.HU.train.batch.feign;

import org.HU.train.common.response.CommonResp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Date;

/**
 * @Author ZUZ
 * @Description: 通过这个接口调用Business模块的"/business/admin/daily-train/gen-daily/{date}"
 * @Date 2024-12-22 13:15
 * @ClassName: BusinessFeign
 */
@FeignClient(value = "business",fallback = BusinessFeignFallback.class)
//@FeignClient(name = "business",url = "http://localhost:8002/business")//该注解表示这个类是一个客户端，而Business是服务端
public interface BusinessFeign {

    @GetMapping("/business/admin/daily-train/gen-daily/{date}")
    CommonResp<Object> genDaily(@PathVariable @DateTimeFormat(pattern = "yyyy-MM-dd") Date date);

    @GetMapping("/business/hello")
    String hello();
}
